Emacs Literate Ontology Tool

Presented to the IOF Technical Oversight Board


Johan W. Klüwer
2024-05-31

Emacs Literate Ontology Tool (ELOT)

By Johan W. Klüwer, with Vladimir Alexiev, Melinda Hodkiewicz. Rewrite
of personal tool, ca. 2016–.


Example: The Pizza Ontology


Tools for authoring ontologies

GUI
great for browsing
  • but inconvenient for editing text
Code editing
flexible, programmable
  • but limited display of structure



An OWL document has no beginning or end. How about narrative,
motivation, clarifications?

BFO ontology and documentation

  • ISO/IEC 21838-2
  • Github repository
    • OWL ontology document
    • First-order axioms
  • Reference guide (2015)
  • Building Ontologies With Basic Formal Ontology (2015)

These are all great, but separately maintained.

Literate programming

Literate programming is a methodology that combines
a programming language with a documentation
language, thereby making programs more robust, more
portable, more easily maintained, and arguably more
fun to write than programs that are written only in
a high-level language. The main idea is to treat a
program as a piece of literature, addressed to human
beings rather than to a computer. […]

(Donald Knuth, Literate Programming homepage)

ELOT: Literate programmming for ontologies

One document for both OWL and documentation

  • Org plaintext outliner format, https://orgmode.org/
    • headings for taxonomy
    • lists for annotations and axioms
    • Literate programming with noweb syntax
    • Manchester Syntax for axioms


Emacs


  • Emacs is “a text editor and more”
    • Free Software Foundation
    • 1976 – public version 13, 1985 – version 29.3, 2024

1

ELOT Feature highlights

  • Ontology and documentation from a single source
  • Convenient editing of annotations
    • Easily add annotations to axioms and annotations
  • Resource lookup
  • Switch between displaying labels and identifiers
  • Diagrams from SPARQL queries
  • Consistency checks
  • OWL format conversion
  • Export to document formats (HTML, PDF, ODT, Markdown, plaintext, …)

Ontology authoring tasks

Make the OWL ontology document

  • Declare resources – request or create identifiers
  • Annotate
  • Build taxonomies of classes and relations
  • Check consistency

plus provide documentation for users

  • Extended discussion
  • Describe modelling patterns
  • Illustrate with example data
  • Illustrate with diagrams

Ontology needs a word processor

Edit annotation texts in a proper environment.

  • Search/replace
  • Spellcheck

  • Seppälä, Ruttenberg, and Smith (2017), “Guidelines for writing definitions in ontologies”.


Emacs is (also) a powerful word processor


Switch between labels and identifiers



“Label display” works in any file

from


to


(Turtle, from PCA)

Easily look up resources to insert

Example: IOF Maintenance Reference Ontology


SPARQL



Export to document formats


The IOF Maintenance Ontology ELOT document exported to HTML

Example: Industrial Data Ontology

The ELOT document exported to Open Document Format, then prepared
for ISO format in MS Word.


The rdfpuml tool

  • “makes true diagrams directly from Turtle examples
  • Uses PlantUML and GraphViz

Benefits:

  • Guarantees consistency between said (triple statements) and shown (diagram)
  • Lets you focus on domain modeling rather than diagram layouting/tweaking
  • Enables efficient source control
  • Saves you lots of effort“

By Vladimir Alexiev; papers 2016, 2023


rdfpuml: rdf:list


rdfpuml: embedded links


rdfpuml: complex diagram


ELOT in context: “Knowledge base” workflow

  • Core OWL ontology: ELOT
  • Ontology patterns in templates: OTTR
    • emacs-ottr-toolkit
  • Data processing
    • SQLite, JSON


ELOT in context: Core ontology, asset model, patterns, ETL all in Emacs


Benefits of Emacs and org-mode

  • Powerful, customizable editing
    • Regular expressions
    • Spellchecking
  • Stable, multi-platform, long life
  • Version control support
  • Flexible display with images and overlays
  • Call external tools
  • Task management/progress tracking
  • Selection of output formats

drawbacks

  • Emacs can be hard to learn
  • Multiple inheritance in outline

ELOT future improvements

Within reach

  • More diagram macros
  • Use more ROBOT services
  • Provide a proper Emacs package
  • Ontology import facility
  • Integrate with OTTR tools

Stretch targets

  • documentation output formats
    • W3C
    • Widoco
    • NISO-STS (XML)